package com.sc.nft.entity.vo.merchantPledgeTask;

import com.sc.nft.enums.EcologyHatchShareProfitMethodConfTypeEnum;
import com.sc.nft.util.BigDecimalUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class AdminEcologyIncomeConfListVO {

    @ApiModelProperty(value = "配置id")
    private Long confId;

    @ApiModelProperty(value = "藏品id")
    private Long collectionId;

    @ApiModelProperty(value = "藏品名称")
    private String collectionName;

    @ApiModelProperty(value = "DAO名称")
    private String daoName;

    @ApiModelProperty(value = "消耗数量")
    private Integer expendCount;

    @ApiModelProperty(value = "熔炼周期")
    private Integer hatchCycle;

    @ApiModelProperty(value = "分享奖励占比")
    private String shareProfitScale;

    @ApiModelProperty(value = "每份分红池占比")
    private String percentagePerDividendPool;

    @ApiModelProperty(value = "风控池占比")
    private String riskPoolScale;

    @ApiModelProperty(value = "技术服务费占比")
    private String technicalServiceFeeScale;

    @ApiModelProperty(value = "双方分账占比")
    private String bothPartiesAccountScale;

    @ApiModelProperty(value = "市值管理占比")
    private String marketValueManagementScale;

    @ApiModelProperty(value = "平台分红占比")
    private String platformProfitScale;

    @ApiModelProperty(value = "品牌分红占比")
    private String brandProfitScale;



    public void setShareProfitScale(BigDecimal shareProfitScale) {
        this.shareProfitScale = shareProfitScale.stripTrailingZeros().toPlainString();
    }

    public void setPercentagePerDividendPool(BigDecimal platformDivideScale) {
        this.percentagePerDividendPool = platformDivideScale.stripTrailingZeros().toPlainString();
    }

    public void setRiskPoolScale(BigDecimal riskPoolScale) {
        this.riskPoolScale = riskPoolScale.stripTrailingZeros().toPlainString();
    }

    public void setTechnicalServiceFeeScale(BigDecimal technicalServiceFeeScale) {
        this.technicalServiceFeeScale = technicalServiceFeeScale.stripTrailingZeros().toPlainString();
    }

    public void setBothPartiesAccountScale(BigDecimal bothPartiesAccountScale) {
        this.bothPartiesAccountScale = bothPartiesAccountScale.stripTrailingZeros().toPlainString();
    }

    public void setMarketValueManagementScale(BigDecimal marketValueManagementScale) {
        this.marketValueManagementScale = marketValueManagementScale.stripTrailingZeros().toPlainString();
    }

    public void setVOList(NewAdminEcologyIncomeConfDetailsVO vo) {
        this.shareProfitScale = vo.getShareProfitScale().stripTrailingZeros().toPlainString();
        if (EcologyHatchShareProfitMethodConfTypeEnum.FIXED_PROPORTION == vo.getType()){
            this.percentagePerDividendPool = BigDecimalUtils.add(vo.getPlatformDivideScale(),vo.getDaoDivideIntoScale()).stripTrailingZeros().toPlainString();
        }else {
            this.percentagePerDividendPool = vo.getPercentagePerDividendPoolScale().stripTrailingZeros().toPlainString();
        }
        this.riskPoolScale = vo.getRiskPoolScale().stripTrailingZeros().toPlainString();
        this.technicalServiceFeeScale = vo.getTechnicalServiceFeeScale().stripTrailingZeros().toPlainString();
        this.bothPartiesAccountScale = vo.getBothPartiesAccountScale().stripTrailingZeros().toPlainString();
        this.marketValueManagementScale = vo.getMarketValueManagementScale().stripTrailingZeros().toPlainString();
    }

    public void setNewVOList(AdminEcologyIncomeConfNewDetailsVO vo) {
        this.shareProfitScale = vo.getShareProfitScale();
        this.platformProfitScale = vo.getPlatformProfitScale();
        this.brandProfitScale = vo.getBrandProfitScale();
        this.riskPoolScale = vo.getRiskPoolScale();
        this.technicalServiceFeeScale = vo.getTechnicalServiceFeeScale();

    }
}
